<template>
  <el-table
    :data="list"
    style="width: 100%"
  >
    <el-table-column label="用户名" prop="username" />
    <el-table-column label="描述" prop="desc" />
  </el-table>
</template>

<script lang="ts">
import { computed, defineComponent, onMounted } from 'vue'
import { useStore } from 'vuex'
import { StateType } from '@/store'
export default defineComponent({
	setup() {
		const store = useStore<StateType>()
		const list = computed(() => store.state.list)

		onMounted(() => {
			store.dispatch('fetch_list')
		})
		
		return {	
			list	
		}
	}
})
</script>
